// phalanx version.hpp.cu header file

// Copyright (c) 2010 - 2011 Kohei Takahashi (Flast).
// Distributed under the MIT license. for more detail see COPYING.

#ifndef IG_PHALANX_DETAIL_VERSION_HPP_CU_ONCE_
#define IG_PHALANX_DETAIL_VERSION_HPP_CU_ONCE_

#include <phalanx/detail/check.hpp.cu>

// CUDA Major/Minor version
#define PHALANX_CUDA_MAJOR_VERSION ( CUDA_VERSION / 1000 )
#define PHALANX_CUDA_MINOR_VERSION ( ( CUDA_VERSION / 10 ) % 100 )

// current CUDA Arch Major/Minor version
#ifdef __CUDA_ARCH__
# define PHALANX_CUDA_ARCH_MAJOR_VERSION ( __CUDA_ARCH__ / 100 )
# define PHALANX_CUDA_ARCH_MINOR_VERSION ( __CUDA_ARCH__ % 100 )
#else
# define PHALANX_CUDA_ARCH_MAJOR_VERSION 1
# define PHALANX_CUDA_ARCH_MINOR_VERSION 0
#endif

#define PHALANX_CUDA_WORKAROUND( version_condition ) \
  ( CUDA_VERSION version_condition )

#define PHALANX_CUDA_MAJOR_WORKAROUND( version_condition ) \
  ( PHALANX_CUDA_MAJOR_VERSION version_condition )

#define PHALANX_CUDA_MINOR_WORKAROUND( version_condition ) \
  ( PHALANX_CUDA_MINOR_VERSION version_condition )

#endif // IG_PHALANX_DETAIL_VERSION_HPP_CU_ONCE_

